package org.tinygroup.dbclustercase;

import java.util.List;

import org.springframework.jdbc.core.JdbcTemplate;
import org.tinygroup.dbclustercase.pojo.VisitMasterIndex;

public class VisitMasterIndexServiceImpl implements VisitMasterService {
	
	private JdbcTemplate jdbcTemplate;
	
	public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
		this.jdbcTemplate = jdbcTemplate;
	}

	public void insert(String sql, Object... args) {
		jdbcTemplate.update(sql, args);
	}

	public void update(String sql, Object... args) {
		jdbcTemplate.update(sql, args);
	}

	public List<VisitMasterIndex> queryList(String sql,Class<VisitMasterIndex> elementType,Object... args) {
		return jdbcTemplate.queryForList(sql, args, elementType);
	}

	public VisitMasterIndex queryObject(String sql,Class<VisitMasterIndex> elementType, Object... args) {
		return jdbcTemplate.queryForObject(sql, elementType, args);
	}

	public void batchUpdate(String sql, List<Object[]> batchArgs) {
		jdbcTemplate.batchUpdate(sql, batchArgs);
	}

}
